﻿<phone:PhoneApplicationPage 
    x:Class="OSChina.SearchPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:water="clr-namespace:WatermarkedTextBoxControl;assembly=WatermarkedTextBoxControl"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
     xmlns:tileEffect="clr-namespace:WP7_ControlsLib.Controls;assembly=WP7_ControlsLib"
    tileEffect:TiltEffect.IsTiltEnabled="True"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    Style="{StaticResource TransitionPageStyle}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False">
    
    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="template_Normal">
            <StackPanel Margin="10,12,0,22">
                <TextBlock Text="{Binding title, Mode=OneTime}" Style="{StaticResource style_DefaultText}" Width="440" HorizontalAlignment="Left" />
                <TextBlock Text="{Binding outline, Mode=OneTime}" Style="{StaticResource style_BodyText}" Foreground="Gray" Margin="0,5,0,0"/>
            </StackPanel>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel 包含应用程序的名称和页标题-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="6,17,0,12">
            <TextBlock x:Name="ApplicationTitle" Text="在开源中国搜索" Style="{StaticResource PhoneTextNormalStyle}"/>
        </StackPanel>

        <!--ContentPanel - 在此处放置其他内容-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="6,0,12,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
                <water:WatermarkedTextBox Name="txtSearch" Watermark="搜索 . . ." Width="468"/>
                <StackPanel Orientation="Horizontal" Grid.Row="1">
                    <RadioButton x:Name="radio_Software" Content="软件" IsChecked="True" Checked="radio_Software_Checked" GroupName="radio" />
                    <RadioButton x:Name="radio_Post" Content="问答" Checked="radio_Software_Checked" GroupName="radio" />
                    <RadioButton x:Name="radio_Blog" Content="博客" Checked="radio_Software_Checked" GroupName="radio" />
                    <RadioButton x:Name="radio_News" Content="资讯" Checked="radio_Software_Checked" GroupName="radio" />
                </StackPanel>
            <ListBox Name="list_Result" Visibility="Collapsed"  Height="514" Margin="0,13,0,0" Grid.Row="2" Grid.ColumnSpan="2" VerticalAlignment="Top" ItemTemplate="{StaticResource template_Normal}" SelectionChanged="list_Result_SelectionChanged">
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <VirtualizingStackPanel CacheMode="BitmapCache"/>
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
            </ListBox>
        </Grid>
    </Grid>
 
    <!--演示 ApplicationBar 用法的示例代码-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" Opacity="0.75" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="iconSearch" IconUri="/Resource/appbar.feature.search.rest.png" Text="搜索" Click="iconSearch_Click" />
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
